package com.ruoyi.adapayBalanceRecord.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.adapayBalanceRecord.mapper.AdapayBalanceRecordMapper;
import com.ruoyi.adapayBalanceRecord.domain.AdapayBalanceRecord;
import com.ruoyi.adapayBalanceRecord.service.IAdapayBalanceRecordService;

/**
 * 余额流水Service业务层处理
 *
 * @author ch
 * @date 2022-02-28
 */
@Service
public class AdapayBalanceRecordServiceImpl implements IAdapayBalanceRecordService
{
    @Autowired
    private AdapayBalanceRecordMapper adapayBalanceRecordMapper;

    /**
     * 查询余额流水
     *
     * @param id 余额流水主键
     * @return 余额流水
     */
    @Override
    public AdapayBalanceRecord selectAdapayBalanceRecordById(Long id)
    {
        return adapayBalanceRecordMapper.selectAdapayBalanceRecordById(id);
    }

    /**
     * 查询余额流水列表
     *
     * @param adapayBalanceRecord 余额流水
     * @return 余额流水
     */
    @Override
    public List<AdapayBalanceRecord> selectAdapayBalanceRecordList(AdapayBalanceRecord adapayBalanceRecord)
    {
        return adapayBalanceRecordMapper.selectAdapayBalanceRecordList(adapayBalanceRecord);
    }

    /**
     * 新增余额流水
     *
     * @param adapayBalanceRecord 余额流水
     * @return 结果
     */
    @Override
    public int insertAdapayBalanceRecord(AdapayBalanceRecord adapayBalanceRecord)
    {
        adapayBalanceRecord.setCreateTime(DateUtils.getNowDate());
        return adapayBalanceRecordMapper.insertAdapayBalanceRecord(adapayBalanceRecord);
    }

    /**
     * 修改余额流水
     *
     * @param adapayBalanceRecord 余额流水
     * @return 结果
     */
    @Override
    public int updateAdapayBalanceRecord(AdapayBalanceRecord adapayBalanceRecord)
    {
        return adapayBalanceRecordMapper.updateAdapayBalanceRecord(adapayBalanceRecord);
    }

    /**
     * 批量删除余额流水
     *
     * @param ids 需要删除的余额流水主键
     * @return 结果
     */
    @Override
    public int deleteAdapayBalanceRecordByIds(Long[] ids)
    {
        return adapayBalanceRecordMapper.deleteAdapayBalanceRecordByIds(ids);
    }


    /**
     * 批量逻辑删除余额流水
     *
     * @param ids 需要删除的余额流水主键
     * @return 结果
     */
    @Override
    public int logicDeleteAdapayBalanceRecord(Long[] ids,String delType,Long delUser)
    {
        return adapayBalanceRecordMapper.logicDeleteAdapayBalanceRecord(ids,delType,delUser);
    }

    /**
     * 删除余额流水信息
     *
     * @param id 余额流水主键
     * @return 结果
     */
    @Override
    public int deleteAdapayBalanceRecordById(Long id)
    {
        return adapayBalanceRecordMapper.deleteAdapayBalanceRecordById(id);
    }

    @Override
    public BigDecimal selectData(Long storeId, Date date) {
        return adapayBalanceRecordMapper.selectData(storeId,date);
    }
}
